package team526.dao;


import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import team526.entity.Video;

import java.util.Date;
import java.util.List;

/**
 * #Date 2021/9/16 - 20:05
 *
 * @author 王铭 20181620310021
 */
@Mapper
public interface VideoDao {

    Video getWithTags(Integer i);

    Video getVideoById(Integer integer);

    List<Video> getVideosByTitle(String titleToSearch);

    List<Video> get100OrderByPlayNum();

    List<Video> searchVideo(@Param("word") String word,
                            @Param("down") Integer down,
                            @Param("up") Integer up,
                            @Param("tagID") Integer tagID,
                            @Param("ordered") Integer ordered,
                            @Param("status") Integer status);


    Integer updateVideo(Video video);

    Integer insertVideo(Video video);

    List<Video> getAllVideos();

    Integer deleteById(Integer i);

    Video getOneWithComments(Integer i);

    List<Video> getAllNormalVideos();

    List<Video> getAllUppedVideos();

    List<Video> getAllUnPassedVideos();

    List<Video> getAllBannedVideos();

    List<Video> getVideosByUuid(Integer uuid, Integer page, Integer num);

    Integer createVideo(Video video);

    Integer createVideo(Integer uuid, String title, String info, Integer length, Date up_time, String cover_pic, String storage);

    Video getVideoByStorage(String storage);

    Integer setPlayNum(Integer play_num, Integer videoid);


    Integer countSearch(@Param("word") String word,
                        @Param("down") Integer down,
                        @Param("up") Integer up,
                        @Param("tagID") Integer tagID,
                        @Param("ordered") Integer ordered,
                        @Param("status") Integer status);
}
